Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update run implementation #923

Closed
wants to merge 2 commits into from

Conversation

ryanzhang-oss
Copy link
Contributor

Description of your changes

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@ryanzhang-oss ryanzhang-oss marked this pull request as draft October 17, 2024 02:32
@ryanzhang-oss ryanzhang-oss force-pushed the update-run-function branch 4 times, most recently from bddc19b to 7db5fd0 Compare October 23, 2024 03:03
apis/placement/v1alpha1/stagedupdate_types.go Outdated Show resolved Hide resolved
apis/placement/v1alpha1/stagedupdate_types.go Outdated Show resolved Hide resolved
}).Complete(r)
}

// handleApprovalRequest find the CRP name from the approval request and enqueue the CRP to the updaterun controller queue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we enqueue the CRP instead of the updateRun?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good eye, should use TargetUpdateRun label

@@ -1,43 +1,39 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header should not be removed.

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"

clusterv1beta1 "go.goms.io/fleet/apis/cluster/v1beta1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to keep the original rename: clusterv1beta1

pkg/controllers/updaterun/executing.go Show resolved Hide resolved
pkg/controllers/updaterun/executing.go Show resolved Hide resolved
pkg/controllers/updaterun/executing.go Show resolved Hide resolved
pkg/controllers/updaterun/executing.go Show resolved Hide resolved
// the rest of the clusters in the stage are not in the tobeDeletedBindings so it should be marked as delete succeeded
for _, clusterStatus := range existingDeleteStageClustersMap {
// make sure the cluster is marked as deleting
if !condition.IsConditionStatusTrue(meta.FindStatusCondition(clusterStatus.Conditions, string(placementv1alpha1.ClusterUpdatingConditionStarted)), updateRun.Generation) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for this condition to happen? The ClusterUpdating never started?

if errors.Is(err, errInitializedFailed) {
return runtime.Result{}, r.recordInitializationFailed(ctx, &updateRun, err.Error())
}
return runtime.Result{}, err
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the initialized failure error means terminating

}).Complete(r)
}

// handleApprovalRequest find the CRP name from the approval request and enqueue the CRP to the updaterun controller queue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good eye, should use TargetUpdateRun label

pkg/controllers/updaterun/initialization.go Show resolved Hide resolved
pkg/controllers/updaterun/initialization.go Show resolved Hide resolved
pkg/controllers/updaterun/initialization.go Show resolved Hide resolved
pkg/controllers/updaterun/validating.go Show resolved Hide resolved
pkg/controllers/updaterun/executing.go Show resolved Hide resolved
pkg/controllers/updaterun/executing.go Show resolved Hide resolved
pkg/controllers/updaterun/executing.go Show resolved Hide resolved
pkg/controllers/updaterun/executing.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants